clc
clear

nc_file = 'E:\Study\Models\hope\run\hope_output.n45.nc';

var_name = 'p';
dot_size  = 100;

ipt  = 1;
ilev = 10;

lon = ncread(nc_file,'lon');
lat = ncread(nc_file,'lat');
eta = ncread(nc_file,'eta');
xi  = ncread(nc_file,'xi');
var = ncread(nc_file,var_name);

lon1d = reshape(lon,[],1);
lat1d = reshape(lat,[],1);
if ndims(var)==4
    var1d = reshape(var(:,:,ilev,:),[],1);
elseif ndims(var)==5
    var1d = reshape(var(ipt,:,:,ilev,:),[],1);
end

ixi  = xi(ipt,ilev,1);

figure
plt = scatter(lon1d,lat1d,dot_size,var1d,'.');
colormap(jet)
xlim([min(lon1d),max(lon1d)])
ylim([min(lat1d),max(lat1d)])
colorbar

title([var_name,' at ',num2str(ixi),' m'])